﻿using Prism.Commands;
using Prism.Services.Dialogs;
using PrismMetroSample.Infrastructure;
using PrismMetroSample.Shell.Aop;

namespace PrismMetroSample.Shell.ViewModels.Dialogs
{
    public class WindowTestViewModel : BaseDialogViewModel
    {
        private readonly IDoWork _dowork;

        public WindowTestViewModel(IDoWork dowork)
        {
            _dowork = dowork;
            Title = "C.tor";
        }


        private DelegateCommand<string> _okCommand;
        public DelegateCommand<string> OkCommand =>
            _okCommand = _okCommand ?? new  DelegateCommand<string>(ExecuteOkCommand);


        #region  Excutes

        [DmoLogCallHandler]
        public virtual void ExecuteOkCommand(string parameter)
        {
            Title = "123";
            //RaisePropertyChanged("Title");

            //ButtonResult result = ButtonResult.None;

            //if (parameter?.ToLower() == "true")
            //    result = ButtonResult.Yes;
            //else if (parameter?.ToLower() == "false")
            //    result = ButtonResult.No;

            //RaiseRequestClose(new DialogResult(result));
        }

        #endregion

    }
}
